package com.itlong.cloud.operate.dao;

import com.itlong.cloud.POJO.VO.operate.OperateAssessFunctionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      运营-报价系统资源菜单数据访问层
 * </desc>
 *
 * @createDate  2020/6/8
 */
@Mapper
@Repository
public interface IOperateAssessFunctionDao {


    /**
     * <desc>
     *      获取报价系统菜单列表
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    List<OperateAssessFunctionVO> getList(Map<String, Object> params);

    /**
     * <desc>
     *      获取报价系统菜单列表数量
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    Integer getListCount(Map<String, Object> params);

    /**
     * <desc>
     *      获取单个报价系统菜单
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    OperateAssessFunctionVO getOne(Map<String, Object> params);


    /**
     * <desc>
     *      获取子节点
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    List<OperateAssessFunctionVO> getChild(@Param("functionId") String functionId,@Param("type") Integer type);

    /**
     * <desc>
     *      更改菜单状态
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    Integer updateStatus(Map<String, Object> params);

    /**
     * <desc>
     *      保存
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    Integer save(Map<String, Object> params);

    /**
     * <desc>
     *      更新操作
     * </desc>
     *
     * @param params 参数map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    Integer update(Map<String, Object> params);

    /**
     * <desc>
     *      获取角色菜单列表
     * </desc>
     *
     * @param roleId 角色id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/9
     */
    List<String> getRoleFunctions(@Param("roleId") String roleId);

    /**
     * <desc>
     *      通过角色id删除该角色拥有的所有节点
     * </desc>
     *
     * @param roleId 角色id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/27
     */
    Integer deleteRoleFunctions(@Param("roleId") String roleId);

    /**
     * <desc>
     *      保存角色的菜单资源
     * </desc>
     *
     * @param params 查询参数
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/26
     */
    Integer saveRoleFunction(Map<String,Object> params);

    /**
     * <desc>
     *      删除功能
     * </desc>
     *
     * @param params 参数Map
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/16
     */
    Integer delete(Map<String,Object> params);

    /**
     * <desc>
     *      获取当前节点所有同级节点
     * </desc>
     *
     * @param parent
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/16
     */
    List<Map<String, Object>> getParentLevelFunctions(@Param("parent") String parent);

    /**
     * <desc>
     *      获取所有父节点
     * </desc>
     *
     * @param parent
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/16
     */
    Map<String, Object> getParent(@Param("parent") String parent);

    /**
     * <desc>
     *      获取角色菜单
     * </desc>
     *
     * @param roleId 角色id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/6/22
     */
    List<OperateAssessFunctionVO> getRoleMenus(String roleId);
}
